import {App} from "vue";
import  {
    ElDialog,
    ElTabs,
    ElForm,
    ElRow,
    ElButton,
    ElMessageBox,
    ElInput,
    ElAutocomplete,
    ElCol,
    ElFormItem,
    ElHeader,
    ElAside,
    ElMain,
    ElContainer,
    ElSubMenu,
    ElMenuItem,
    ElMenu,
    ElIcon,
    ElMenuItemGroup, ElTabPane,
} from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import "element-plus/dist/index.css"
export const components: any[] = [
    ElButton,
    ElInput,
    ElAutocomplete,
    ElCol,
    ElRow,
    ElFormItem,
    ElForm,
    ElHeader,
    ElAside,
    ElMain,
    ElContainer,
    ElMenu,
    ElSubMenu,
    ElMenuItem,
    ElIcon,
    ElMenuItemGroup,
    ElTabPane,
    ElTabs,
    ElDialog
]
export const plugins: any[] = [ElMessageBox]
export function setupElementPlus(app:App){
    components.forEach(component => {
        app.component(component.name!, component)
    })
    plugins.forEach(plugin => {
        app.use(plugin)
    })
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
        app.component(key, component)
    }
}
